<?php

/**
 * 小程序服务商管理系统 v1.0.1
 *
 * 商业运营到axzz.cn官网进行授权使用。
 *
 * (c) cighsen02 <xiayu@959602.com>
 *
 * Create at：2025.05.03
*/

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;

/**
 * 权限管理
 */
class RoleController extends Controller implements HasMiddleware
{
    /**
     * 权限中间件
     *
     * @return array
     */
    public static function middleware(): array
    {
         return [
            'auth:user',
            new Middleware('permission:role-list|role-create|role-edit|role-delete', only: ['index','show']),
            new Middleware('permission:role-create', only: ['store']),
            new Middleware('permission:role-edit', only: ['update']),
            new Middleware('permission:role-delete', only: ['destroy'])
        ];
    }
}
